## About
This is a POSIX compliant shell script for downloading and updating the Firefox and Thunderbird [`user.js`](https://kb.mozillazine.org/User.js_file) from [Privacy-Handbuch](https://www.privacy-handbuch.de).


## Installation

If you are using Arch Linux you can install from the [AUR](https://aur.archlinux.org/packages/ph-userjs-updater) with your favorite helper, for example:
```
paru -S ph-userjs-updater
```
Otherwise you have to download the [updater](https://notabug.org/TotallyLeGIT/PH-userjs-updater/raw/main/updater) to a path of your liking, e. g. `~/.local/bin/ph-userjs-updater`. If you put it into a directory which is included in the `PATH` variable you can omit the directory later on when calling the script. After downloading you need to make the script executable: `chmod +x ~/.local/bin/ph-userjs-updater`.


## Usage

It is recommended to close Firefox and/or Thunderbird before changing their `user.js`es, i. e. before running the updater. Changes will take effect at the next start.

The first thing you likely want to do is decide which [Firefox](https://www.privacy-handbuch.de/handbuch_21u.htm) or [Thunderbird](https://www.privacy-handbuch.de/handbuch_31p.htm) configuration you want to install to which profile.

To install a new `user.js` you have to specify which configuration you want and a profile path. For the latter you might either use `-l`, `-p /path/to/a/profile` or `cd` into the profile directory prior to calling the updater. It might look like this: `ph-userjs-updater -c moderat -p ~/.mozilla/firefox/bqwe10y4.profile1` (Replace the executable name with whatever you have chosen when downloading the script and prepend the directory if it is not included in your `$PATH`).

For updating `user.js`es the option `-a` comes in handy. It will update every profile in the default directory locations (`~/.mozilla/firefox/` and `~/.thunderbird/`) where a `user.js` from Privacy-Handbuch is already present. So make sure all profiles are set up individually prior to automated updating. For automation you should also at least use the option `-y` so the updater won't hang waiting for your confirmation. You might also let the updater update itself through the option `-u` if you did not install via AUR and get your updates from there. One example for updating all Firefox and Thunderbird profiles with previously installed `user.js`es is `ph-userjs-updater -adquy`.

The updater will by default search for a `user-overrides.js` in each selected profile directory and append it to the downloaded `user.js`. The options from `user-overrides.js` will take precedence over those from the `user.js` which allows you to override individual options permanently so you can adjust your profile to your needs.


## Maintenance
**Is this software still maintained?**

Yes. There's not much to update, that's why the last commit might date back quite a while. Don't worry though, I will be notified of new issues.


## Acknowledgment
This script is based on the [ghacks (now known as arkenfox) `user.js` updater.sh](https://github.com/arkenfox/user.js/blob/master/updater.sh). Thanks for all your work!


## Related Projects
* [arkenfox Firefox user.js](https://github.com/arkenfox/user.js)
* [HorlogeSkynet Thunderbird user.js](https://github.com/HorlogeSkynet/thunderbird-user.js)
* [Privacy-Handbuch](https://www.privacy-handbuch.de/handbuch_21u.htm)
